<script setup>

const props = defineProps({
  show: {
    type: Boolean,
  },
});

const emits = defineEmits(["click"]);

</script>

<template>
  <view class="backTop" :class="{show}" @click="emits('click')">
    <text>顶部</text>
  </view>
</template>

<style scoped lang="scss">
.backTop {
  position: fixed;
  bottom: 200rpx;
  right: 50rpx;
  width: 80rpx;
  height: 80rpx;
  background-color: #ef4f3f;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 100%;
  font-size: 20rpx;
  color: #ffffff;
  font-weight: 600;
  transition: all .4s linear;
  opacity: 0;

  &.show {
    opacity: 1;
  }
}
</style>
